<!DOCTYPE html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="initial-scale=1, user-scalable=no, width=device-width">
  <title>map</title>
  <link rel="stylesheet" href="test/css/index.css" type="text/css">
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    body {
      /* background-color: #eeeeee; */
    }

    li {
      list-style: none;
    }

    #map {
      right: 160px;
      width: auto;
    }

    .test-wrap {
      position: absolute;
      right: 0;
      width: 160px;
    }

    .test-wrap>ul>li {
      text-align: left;
      padding: 10px 20px;
      background: #ffffff;
      color: #999999;
      border-bottom: 1px solid #eeeeee;
      font-size: 14px;
      cursor: pointer;
    }

    /* 气泡 */
    .ol-popup {
      font-size: 14px;
      position: absolute;
      background-color: white;
      -webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
      filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
      padding: 15px;
      border-radius: 10px;
      border: 1px solid #cccccc;
      bottom: 12px;
      left: -50px;
      min-width: 280px;
      display: none;
    }

    .ol-overlay-container>.ol-popup {
      display: block;
    }

    .ol-popup:after,
    .ol-popup:before {
      top: 100%;
      border: solid transparent;
      content: " ";
      height: 0;
      width: 0;
      position: absolute;
      pointer-events: none;
    }

    .ol-popup:after {
      border-top-color: white;
      border-width: 10px;
      left: 48px;
      margin-left: -10px;
    }

    .ol-popup:before {
      border-top-color: #cccccc;
      border-width: 11px;
      left: 48px;
      margin-left: -11px;
    }

    .ol-popup-closer {
      text-decoration: none;
      position: absolute;
      top: 2px;
      right: 8px;
      color: #cccccc;
    }

    .ol-popup-closer:hover {
      color: red;
    }

    .ol-popup-closer:after {
      content: "✖";
    }

    /* 闪烁 */

    .point-animate {
      height: 50px;
      width: 50px;
      border-radius: 25px;
      background: rgba(255, 0, 0, 0.9);
      transform: scale(0);
      animation: myfirst 2s;
      animation-iteration-count: infinite;
    }

    @keyframes myfirst {
      to {
        transform: scale(2);
        background: rgba(0, 0, 0, 0);
      }
    }


    .info {
      position: absolute;
      top: 10px;
      right: 200px;
      color: red;
    }

    .center {
      background: #ffffff;
      border: 1px solid #cccccc;
      padding: 6px 20px
    }

    #mounse-location {
      position: fixed;
      bottom: 10px;
      right: 200px;
      color: red;
      font-weight: bold;
    }
  </style>
</head>

<body>
  <div id="map"></div>
  <div class="info">
    <span id="mounse-location" class=""></span>
    <span id="center" class="center"></span>
  </div>
  <div class="test-wrap" id="wrap">
    <ul>
      <li data-type="4">文档</li>
      <li data-type="0">谷歌地图</li>
      <li data-type="1">谷歌影像</li>
      <li data-type="2">高德地图</li>
      <li data-type="3">高德影像</li>
      <li data-type="5">点</li>
      <li data-type="6">线</li>
      <li data-type="7">面</li>
      <li data-type="8">描边</li>
      <li data-type="9">气泡</li>

      <li data-type="99">空气质量显示</li>
    </ul>
  </div>
  <div id="popup" class="ol-popup">
    <a href="#" id="popup-closer" class="ol-popup-closer"></a>
    <div id="popup-centent"></div>
  </div>
  <script src="lib/js/olmaps.js"></script>
  <script src="test/js/data.js"></script>
  <script src="test/js/test.js"></script>
  <script>
    _$id('wrap').addEventListener('click', function (e) {
      var id = Number(e.target.getAttribute('data-type'))
      if (id <= 3) {
        olmaps.setMapType(id)
        return
      }
      switch (id) {
        case 4:
          window.open('./README.html')
          break;
        case 5:
          init5()
          break;
        case 6:
          init6()
          break;
        case 7:
          init7()
          break;
        case 8:
          init8()
          break;
        case 9:
          init9()
          break;
        case 99:
          pm25()
          break;
        default:
          break;
      }
    })
    bindEvent()
  </script>

</body>

</html>